\(\int \frac {(a+b x) (c+d x) (e+f x)}{g+h x} \, dx\) [2]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 126 \[ \int \frac {(a+b x) (c+d x) (e+f x)}{g+h x} \, dx=\frac {(b (d g-c h) (f g-e h)-a h (d f g-d e h-c f h)) x}{h^3}+\frac {(a d f h-b (d f g-d e h-c f h)) x^2}{2 h^2}+\frac {b d f x^3}{3 h}-\frac {(b g-a h) (d g-c h) (f g-e h) \log (g+h x)}{h^4} \]

[Out]

(b*(-c*h+d*g)*(-e*h+f*g)-a*h*(-c*f*h-d*e*h+d*f*g))*x/h^3+1/2*(a*d*f*h-b*(-c*f*h-d*e*h+d*f*g))*x^2/h^2+1/3*b*d*
f*x^3/h-(-a*h+b*g)*(-c*h+d*g)*(-e*h+f*g)*ln(h*x+g)/h^4

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.043, Rules used = {147} \[ \int \frac {(a+b x) (c+d x) (e+f x)}{g+h x} \, dx=-\frac {(b g-a h) (d g-c h) (f g-e h) \log (g+h x)}{h^4}+\frac {x (b (d g-c h) (f g-e h)-a h (-c f h-d e h+d f g))}{h^3}+\frac {x^2 (a d f h-b (-c f h-d e h+d f g))}{2 h^2}+\frac {b d f x^3}{3 h} \]

[In]

Int[((a + b*x)*(c + d*x)*(e + f*x))/(g + h*x),x]

[Out]

((b*(d*g - c*h)*(f*g - e*h) - a*h*(d*f*g - d*e*h - c*f*h))*x)/h^3 + ((a*d*f*h - b*(d*f*g - d*e*h - c*f*h))*x^2
)/(2*h^2) + (b*d*f*x^3)/(3*h) - ((b*g - a*h)*(d*g - c*h)*(f*g - e*h)*Log[g + h*x])/h^4

Rule 147

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_) + (f_.)*(x_))*((g_.) + (h_.)*(x_)), x_Symbol]
:> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)*(g + h*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h},
x] && (IGtQ[m, 0] || IntegersQ[m, n])

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {b (d g-c h) (f g-e h)-a h (d f g-d e h-c f h)}{h^3}+\frac {(a d f h-b (d f g-d e h-c f h)) x}{h^2}+\frac {b d f x^2}{h}+\frac {(-b g+a h) (-d g+c h) (-f g+e h)}{h^3 (g+h x)}\right ) \, dx \\ & = \frac {(b (d g-c h) (f g-e h)-a h (d f g-d e h-c f h)) x}{h^3}+\frac {(a d f h-b (d f g-d e h-c f h)) x^2}{2 h^2}+\frac {b d f x^3}{3 h}-\frac {(b g-a h) (d g-c h) (f g-e h) \log (g+h x)}{h^4} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.98 \[ \int \frac {(a+b x) (c+d x) (e+f x)}{g+h x} \, dx=\frac {h x \left (3 a h (2 c f h+d (-2 f g+2 e h+f h x))+b \left (3 d e h (-2 g+h x)+3 c h (-2 f g+2 e h+f h x)+d f \left (6 g^2-3 g h x+2 h^2 x^2\right )\right )\right )-6 (b g-a h) (d g-c h) (f g-e h) \log (g+h x)}{6 h^4} \]

[In]

Integrate[((a + b*x)*(c + d*x)*(e + f*x))/(g + h*x),x]

[Out]

(h*x*(3*a*h*(2*c*f*h + d*(-2*f*g + 2*e*h + f*h*x)) + b*(3*d*e*h*(-2*g + h*x) + 3*c*h*(-2*f*g + 2*e*h + f*h*x)
+ d*f*(6*g^2 - 3*g*h*x + 2*h^2*x^2))) - 6*(b*g - a*h)*(d*g - c*h)*(f*g - e*h)*Log[g + h*x])/(6*h^4)

Maple [A] (verified)

Time = 1.52 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.39

method result size
norman \(\frac {\left (a c f \,h^{2}+a d e \,h^{2}-a d f g h +b c e \,h^{2}-b c f g h -b d e g h +b d f \,g^{2}\right ) x}{h^{3}}+\frac {\left (a d f h +b c f h +b d e h -b d f g \right ) x^{2}}{2 h^{2}}+\frac {b d f \,x^{3}}{3 h}+\frac {\left (a c e \,h^{3}-a c f g \,h^{2}-a d e g \,h^{2}+a d f \,g^{2} h -b c e g \,h^{2}+b c f \,g^{2} h +b d e \,g^{2} h -b d f \,g^{3}\right ) \ln \left (h x +g \right )}{h^{4}}\) \(175\)
default \(\frac {\frac {1}{3} b d f \,x^{3} h^{2}+\frac {1}{2} a d f \,h^{2} x^{2}+\frac {1}{2} b c f \,h^{2} x^{2}+\frac {1}{2} b d e \,h^{2} x^{2}-\frac {1}{2} b d f g h \,x^{2}+a c f \,h^{2} x +a d e \,h^{2} x -a d f g h x +b c e \,h^{2} x -b c f g h x -b d e g h x +b d f \,g^{2} x}{h^{3}}+\frac {\left (a c e \,h^{3}-a c f g \,h^{2}-a d e g \,h^{2}+a d f \,g^{2} h -b c e g \,h^{2}+b c f \,g^{2} h +b d e \,g^{2} h -b d f \,g^{3}\right ) \ln \left (h x +g \right )}{h^{4}}\) \(194\)
risch \(\frac {b d f \,x^{3}}{3 h}+\frac {a d f \,x^{2}}{2 h}+\frac {b c f \,x^{2}}{2 h}+\frac {b d e \,x^{2}}{2 h}-\frac {b d f g \,x^{2}}{2 h^{2}}+\frac {a c f x}{h}+\frac {a d e x}{h}-\frac {a d f g x}{h^{2}}+\frac {b c e x}{h}-\frac {b c f g x}{h^{2}}-\frac {b d e g x}{h^{2}}+\frac {b d f \,g^{2} x}{h^{3}}+\frac {\ln \left (h x +g \right ) a c e}{h}-\frac {\ln \left (h x +g \right ) a c f g}{h^{2}}-\frac {\ln \left (h x +g \right ) a d e g}{h^{2}}+\frac {\ln \left (h x +g \right ) a d f \,g^{2}}{h^{3}}-\frac {\ln \left (h x +g \right ) b c e g}{h^{2}}+\frac {\ln \left (h x +g \right ) b c f \,g^{2}}{h^{3}}+\frac {\ln \left (h x +g \right ) b d e \,g^{2}}{h^{3}}-\frac {\ln \left (h x +g \right ) b d f \,g^{3}}{h^{4}}\) \(246\)
parallelrisch \(\frac {2 b d f \,x^{3} h^{3}+3 x^{2} a d f \,h^{3}+3 x^{2} b c f \,h^{3}+3 x^{2} b d e \,h^{3}-3 x^{2} b d f g \,h^{2}+6 \ln \left (h x +g \right ) a c e \,h^{3}-6 \ln \left (h x +g \right ) a c f g \,h^{2}-6 \ln \left (h x +g \right ) a d e g \,h^{2}+6 \ln \left (h x +g \right ) a d f \,g^{2} h -6 \ln \left (h x +g \right ) b c e g \,h^{2}+6 \ln \left (h x +g \right ) b c f \,g^{2} h +6 \ln \left (h x +g \right ) b d e \,g^{2} h -6 \ln \left (h x +g \right ) b d f \,g^{3}+6 x a c f \,h^{3}+6 x a d e \,h^{3}-6 x a d f g \,h^{2}+6 x b c e \,h^{3}-6 x b c f g \,h^{2}-6 x b d e g \,h^{2}+6 x b d f \,g^{2} h}{6 h^{4}}\) \(248\)

[In]

int((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x,method=_RETURNVERBOSE)

[Out]

(a*c*f*h^2+a*d*e*h^2-a*d*f*g*h+b*c*e*h^2-b*c*f*g*h-b*d*e*g*h+b*d*f*g^2)/h^3*x+1/2/h^2*(a*d*f*h+b*c*f*h+b*d*e*h
-b*d*f*g)*x^2+1/3*b*d*f*x^3/h+(a*c*e*h^3-a*c*f*g*h^2-a*d*e*g*h^2+a*d*f*g^2*h-b*c*e*g*h^2+b*c*f*g^2*h+b*d*e*g^2
*h-b*d*f*g^3)/h^4*ln(h*x+g)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.29 \[ \int \frac {(a+b x) (c+d x) (e+f x)}{g+h x} \, dx=\frac {2 \, b d f h^{3} x^{3} - 3 \, {\left (b d f g h^{2} - {\left (b d e + {\left (b c + a d\right )} f\right )} h^{3}\right )} x^{2} + 6 \, {\left (b d f g^{2} h - {\left (b d e + {\left (b c + a d\right )} f\right )} g h^{2} + {\left (a c f + {\left (b c + a d\right )} e\right )} h^{3}\right )} x - 6 \, {\left (b d f g^{3} - a c e h^{3} - {\left (b d e + {\left (b c + a d\right )} f\right )} g^{2} h + {\left (a c f + {\left (b c + a d\right )} e\right )} g h^{2}\right )} \log \left (h x + g\right )}{6 \, h^{4}} \]

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x, algorithm="fricas")

[Out]

1/6*(2*b*d*f*h^3*x^3 - 3*(b*d*f*g*h^2 - (b*d*e + (b*c + a*d)*f)*h^3)*x^2 + 6*(b*d*f*g^2*h - (b*d*e + (b*c + a*
d)*f)*g*h^2 + (a*c*f + (b*c + a*d)*e)*h^3)*x - 6*(b*d*f*g^3 - a*c*e*h^3 - (b*d*e + (b*c + a*d)*f)*g^2*h + (a*c
*f + (b*c + a*d)*e)*g*h^2)*log(h*x + g))/h^4

Sympy [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.16 \[ \int \frac {(a+b x) (c+d x) (e+f x)}{g+h x} \, dx=\frac {b d f x^{3}}{3 h} + x^{2} \left (\frac {a d f}{2 h} + \frac {b c f}{2 h} + \frac {b d e}{2 h} - \frac {b d f g}{2 h^{2}}\right ) + x \left (\frac {a c f}{h} + \frac {a d e}{h} - \frac {a d f g}{h^{2}} + \frac {b c e}{h} - \frac {b c f g}{h^{2}} - \frac {b d e g}{h^{2}} + \frac {b d f g^{2}}{h^{3}}\right ) + \frac {\left (a h - b g\right ) \left (c h - d g\right ) \left (e h - f g\right ) \log {\left (g + h x \right )}}{h^{4}} \]

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x)

[Out]

b*d*f*x**3/(3*h) + x**2*(a*d*f/(2*h) + b*c*f/(2*h) + b*d*e/(2*h) - b*d*f*g/(2*h**2)) + x*(a*c*f/h + a*d*e/h -
a*d*f*g/h**2 + b*c*e/h - b*c*f*g/h**2 - b*d*e*g/h**2 + b*d*f*g**2/h**3) + (a*h - b*g)*(c*h - d*g)*(e*h - f*g)*
log(g + h*x)/h**4

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.29 \[ \int \frac {(a+b x) (c+d x) (e+f x)}{g+h x} \, dx=\frac {2 \, b d f h^{2} x^{3} - 3 \, {\left (b d f g h - {\left (b d e + {\left (b c + a d\right )} f\right )} h^{2}\right )} x^{2} + 6 \, {\left (b d f g^{2} - {\left (b d e + {\left (b c + a d\right )} f\right )} g h + {\left (a c f + {\left (b c + a d\right )} e\right )} h^{2}\right )} x}{6 \, h^{3}} - \frac {{\left (b d f g^{3} - a c e h^{3} - {\left (b d e + {\left (b c + a d\right )} f\right )} g^{2} h + {\left (a c f + {\left (b c + a d\right )} e\right )} g h^{2}\right )} \log \left (h x + g\right )}{h^{4}} \]

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x, algorithm="maxima")

[Out]

1/6*(2*b*d*f*h^2*x^3 - 3*(b*d*f*g*h - (b*d*e + (b*c + a*d)*f)*h^2)*x^2 + 6*(b*d*f*g^2 - (b*d*e + (b*c + a*d)*f
)*g*h + (a*c*f + (b*c + a*d)*e)*h^2)*x)/h^3 - (b*d*f*g^3 - a*c*e*h^3 - (b*d*e + (b*c + a*d)*f)*g^2*h + (a*c*f
+ (b*c + a*d)*e)*g*h^2)*log(h*x + g)/h^4

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.59 \[ \int \frac {(a+b x) (c+d x) (e+f x)}{g+h x} \, dx=\frac {2 \, b d f h^{2} x^{3} - 3 \, b d f g h x^{2} + 3 \, b d e h^{2} x^{2} + 3 \, b c f h^{2} x^{2} + 3 \, a d f h^{2} x^{2} + 6 \, b d f g^{2} x - 6 \, b d e g h x - 6 \, b c f g h x - 6 \, a d f g h x + 6 \, b c e h^{2} x + 6 \, a d e h^{2} x + 6 \, a c f h^{2} x}{6 \, h^{3}} - \frac {{\left (b d f g^{3} - b d e g^{2} h - b c f g^{2} h - a d f g^{2} h + b c e g h^{2} + a d e g h^{2} + a c f g h^{2} - a c e h^{3}\right )} \log \left ({\left | h x + g \right |}\right )}{h^{4}} \]

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x, algorithm="giac")

[Out]

1/6*(2*b*d*f*h^2*x^3 - 3*b*d*f*g*h*x^2 + 3*b*d*e*h^2*x^2 + 3*b*c*f*h^2*x^2 + 3*a*d*f*h^2*x^2 + 6*b*d*f*g^2*x -
 6*b*d*e*g*h*x - 6*b*c*f*g*h*x - 6*a*d*f*g*h*x + 6*b*c*e*h^2*x + 6*a*d*e*h^2*x + 6*a*c*f*h^2*x)/h^3 - (b*d*f*g
^3 - b*d*e*g^2*h - b*c*f*g^2*h - a*d*f*g^2*h + b*c*e*g*h^2 + a*d*e*g*h^2 + a*c*f*g*h^2 - a*c*e*h^3)*log(abs(h*
x + g))/h^4

Mupad [B] (verification not implemented)

Time = 2.82 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.38 \[ \int \frac {(a+b x) (c+d x) (e+f x)}{g+h x} \, dx=x\,\left (\frac {a\,c\,f+a\,d\,e+b\,c\,e}{h}-\frac {g\,\left (\frac {a\,d\,f+b\,c\,f+b\,d\,e}{h}-\frac {b\,d\,f\,g}{h^2}\right )}{h}\right )+x^2\,\left (\frac {a\,d\,f+b\,c\,f+b\,d\,e}{2\,h}-\frac {b\,d\,f\,g}{2\,h^2}\right )+\frac {\ln \left (g+h\,x\right )\,\left (a\,c\,e\,h^3-b\,d\,f\,g^3-a\,c\,f\,g\,h^2-a\,d\,e\,g\,h^2-b\,c\,e\,g\,h^2+a\,d\,f\,g^2\,h+b\,c\,f\,g^2\,h+b\,d\,e\,g^2\,h\right )}{h^4}+\frac {b\,d\,f\,x^3}{3\,h} \]

[In]

int(((e + f*x)*(a + b*x)*(c + d*x))/(g + h*x),x)

[Out]

x*((a*c*f + a*d*e + b*c*e)/h - (g*((a*d*f + b*c*f + b*d*e)/h - (b*d*f*g)/h^2))/h) + x^2*((a*d*f + b*c*f + b*d*
e)/(2*h) - (b*d*f*g)/(2*h^2)) + (log(g + h*x)*(a*c*e*h^3 - b*d*f*g^3 - a*c*f*g*h^2 - a*d*e*g*h^2 - b*c*e*g*h^2
 + a*d*f*g^2*h + b*c*f*g^2*h + b*d*e*g^2*h))/h^4 + (b*d*f*x^3)/(3*h)